﻿using System;
using System.Collections.Generic;

using TradeCore.Quote;
using TradeCore.Trade;

namespace TradeCore.Model
{
    /// <summary>
    /// 策略类基类（定义了行情接口和交易接口）
    /// 策略类必须实现该接口，以便行情线程能调用策略进行交易
    /// </summary>
    public abstract class PolicyBase
    {
        /// <summary>
        /// 行情接口对象
        /// </summary>
        protected QuoteManager quoteManager;

        /// <summary>
        /// 交易接口对象
        /// </summary>
        protected TradeManager tradeManager;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="paramTradeManager">交易接口对象</param>
        protected PolicyBase()
        {
            quoteManager = QuoteManager.GetInstance();
            tradeManager = TradeManager.GetInstance();
        }


        /******************************** 策略接口 ********************************/

        /// <summary>
        /// 策略名称
        /// </summary>
        public abstract string PolicyName { get; }

        /// <summary>
        /// K线更新事件处理程序
        /// </summary>
        public abstract void PriceUpdate(KLineSeries series);

        /// <summary>
        /// K线完成事件
        /// </summary>
        public abstract void KLineFinished(KLineSeries series);

        /// <summary>
        /// K线新开事件
        /// </summary>
        public abstract void KLineOpen(KLineSeries series);
    }
}
